
<style type="text/css">
.ui.modal>.actions {
    background: #FFF; 
    padding: 1rem;
    border-top: 1px solid rgba(34,36,38,.15);
    text-align: right;
}
.cont{ min-height: 831px;
}
</style>
<div class="cont">
  <div class="position "><img alt="位置图标" src="dist/images/position.png" />营销管理&gt;报价管理</div>
  <div class="menus">
    <div class="menus_con" style="margin-top:-40px;"> 
      <ul>
        <li id="sub_company"> 
            <label for="textfield" class="li_lable">所属分公司</label>
            <select class="ui dropdown" name="search_sub_company" id="search_sub_company">
              <option ng-repeat="v in search_company" value="{{v.sector_id}}">{{v.sector_name}}</option>
            </select>
        </li>
        <li>
            <label for="textfield" class="li_lable" >所属产品</label>
            <select class="select_text2" name="search_sub_product" id="search_sub_product">
              <option  value="" selected disabled hidden>所属产品</option>
              <option ng-repeat="list in search_product" value="{{list.product_id}}" id="product{{$index}}">{{list.company_name}} {{list.name}}</option>
            </select>
        <li>
            <label for="textfield" class="li_lable">服务期类型</label>
            <select class="select_text2" name="search_service_type" id="search_service_type">
              <option value="-1" selected disabled hidden>服务期类型</option>
              <option value="-1">全部类型</option>
              <option value="12m">按年</option>
              <option value="6m">按半年</option>
              <option value="3m">按季度</option>
              <option value="1m">按月度</option>
            </select>
        </li>  
        <li><a ng-click="ProductPriceList()">查找</a></li>
        <li><a ng-click="showAdd()" style="width:160px;"><i class="plus icon" ></i>添加产品报价</a></li>
      </ul>
    </div>


    <div class="menus_table" style="margin-top: -40px;">
      <div class="ui thirteen wide">
         <table class="ui column table">
          <thead>
            <tr>
              <th>报价规则</th>
              <th>归属产品</th>
              <th>服务时间</th>
              <th>全价</th>
              <th>优惠时间(月)</th>
              <th>优惠价格</th>
              <th class="note">备注信息</th>
              <th class="operate">操作</th>
            </tr>
          </thead>
          <tbody id="y_product_list">
            <tr ng-repeat="list in product_price">
              <td>{{list.name}}</td>
              <td>{{list.product_name}}</td>
              <td ng-switch="list.service_time">
                <span ng-switch-when="12m">1年</span>
                <span ng-switch-when="6m">半年</span>
                <span ng-switch-when="3m">季度</span>
                <span ng-switch-when="1m">月度</span>
              </td>
              <td>{{list.price}}</td>
              <td ng-if="list.free_time ==0"></td>
               <td ng-if="list.free_time !=0">{{list.free_time}}</td>
              <td>
                  {{list.free_price}}
              </td>
              <td class="note" >{{list.note}}</td>
              <td class="operate">
                <a title="编辑退款查账信息"  ng-click="save_product_price(list.price_id)">
                  <img alt="编辑方式图标" src="dist/images/edit.png">
                </a> 
                <a title="编辑退款查账信息" ng-click="delete(list.price_id,list.name,list.product_name)" style="margin-left:10px;">
                  <img alt="删除方式图标" src="dist/images/del.png">
                </a>    
              </td>
            </tr>
          </tbody>
           <tbody id="w_product_list">
            <tr>
              <td colspan="8" style="text-align:center;margin-top:10px" class="null_data">没有找到数据~~~</td>
            </tr>
           </tbody>
        </table>
          <div  class="ui pagination menu" jspagination   page-object="ProductPricePagess" page-func="ProductPriceList" ng-if="ProductPricePagess.pageAll > 1" ></div>
      </div>
    </div>
  </div>
</div>

<div class="ui product_price_add modal " >
  <i class="close icon"></i>
  <div class="header_h4">
   添加产品报价
  </div>
    <div class="content">
      <form class="ui form" action="#" name="frm-add" id="frm-add">
          <div class="inline fluid fields">
            <div class="field" style="width:50%;margin-left:16px;">
              <label>报价名称</label>
              <input name="add_name" type="text" value="" style="width:44%;">
            </div>
            <div class="field" style="width:50%">
               <label>所属产品</label>
                <div class="ui selection dropdown" style="width:220px">
                  <input type="hidden" name="add_product_name" id="add_product_name"  value="">
                  <i class="dropdown icon"></i>
                  <div class="default text" id="adefault_product">所属产品</div>
                  <div class="menu">
                    <div class="item" ng-repeat="x in product_name" data-value="{{x.product_id}}">{{x.company_name}}  {{x.name}}</div>
                  </div>
                </div>
            </div>
          </div>

          <div class="inline fluid fields">
            <div class="field" style="width:50%" id="add_discount_check">
               <label>服务期类型</label>
                <div class="ui selection dropdown" >
                  <input type="hidden" name="add_service_time" id="add_service_time"  value="" >
                  <i class="dropdown icon"></i>
                  <div class="default text" id="default_service_time">服务期类型</div>
                  <div class="menu" ng-click="check_price()">
                    <div class="item" ng-repeat="v in service_time" data-value="{{v.id}}" >{{v.time}}</div>
                  </div>
                </div>
            </div>
            <div class="field" id="add_quan_price" style="width:50%">
              <label>全价(元)</label>
              <input name="add_price" id="add_price" type="text" ng-keyup="check_price()" value="" style="margin-left:34px; width:49%">
            </div>
          </div>

          <div class="inline fluid fields" >
            <div class="field" id="add_free_price" style="width:50%">
              <label>优惠后价格(元)</label>
              <input name="add_service_price" id="add_service_price" type="text"  ng-keyup="check_price()" value="" style="width:44%;">

            </div>
            <div class="field" id="service" style="width:50%">
              <label>优惠后延长服务月数(月)</label>
              <input name="add_free_time" id="add_free_time" type="text" ng-keyup="check_price()" value="">
            </div>
          </div>
            <div class="inline fluid fields">
            <div class="field" style="width:50%">
              <label>实际折扣</label>
              <span style="margin-left:16px;" id="adiscount" >{{add_discount |limitTo:4 }} 折</span>
            </div>
          </div>
           <div class="inline fluid fields">
            <div class="field">
              <label>备注信息</label>
              <textarea  ng-model="add_note" name="add_note" id="textarea" style="margin-left:60px;" ></textarea>
            </div>
          </div>
           <div class="ui error message"></div>
        </form>
    </div>
    <div class="actions" style="margin-top:20px;">
       <div class="center" style="margin-top:-60px;">
        <div class="ui pop_btn_qd positive" >{{'BTN_OK' | translate}}</div>
        <div class="ui pop_btn_qx negative" >{{'BTN_CANCEL' | translate}}</div>
       </div>
    </div>
</div>


<div class="ui product_price_save modal " >
  <i class="close icon"></i>
  <div class="header_h4">
   编辑产品报价
  </div>
  <div class="content">
    <form class="ui form"  name="frm-save" id="frm-save">
          <div class="inline fluid fields ">
            <div class="field" id="save_name_check" style="width:50%">
              <label>报价名称</label>
              <input name="save_name" type="text" style="margin-left:14px;width:44%">
            </div>
            <div class="field" id="save_product_name_check" style="width:50%">
               <label>所属产品</label>
                <div class="ui selection dropdown" style="width:240px;">
                  <input type="hidden" name="save_product_name" id="save_product_name"  value="">
                  <i class="dropdown icon"></i>
                  <div class="item text" id="default_save_product_name" data-value="{{arr_price.product_id}}" >{{arr_price.product_name}}</div>
                  <div class="menu">
                    <div class="item" ng-repeat="y in eidt_product" data-value="{{y.product_id}}" > {{y.company_name}} {{y.name}}</div>
                  </div>
                </div>
            </div>
          </div>

          <div class="inline fluid fields">
            <div class="field" id="service_type" style="width:50%">
                <label>服务期类型</label>
                <div class="ui selection dropdown" >
                  <input type="hidden" name="save_service_time" id="save_service_time"  value="">
                  <i class="dropdown icon"></i>
                  <div class="item text" id="default_save_service_time"  ng-switch="arr_price.service_time">
                     <div ng-switch-when="1m">
                      <input type="hidden" name="save_switch_service_time" id="save_switch_service_time"  value="1m">
                       <p>按月度</p>
                    </div>
                    <div ng-switch-when="3m">
                      <input type="hidden" name="save_switch_service_time" id="save_switch_service_time"  value="3m">
                       <p>按季度</p>
                    </div>
                    <div ng-switch-when="6m">
                      <input type="hidden" name="save_switch_service_time" id="save_switch_service_time"  value="6m">
                       <p>按半年</p>
                    </div>
                    <div ng-switch-when="12m">
                        <input type="hidden" name="save_switch_service_time" id="save_switch_service_time"  value="12m">
                       <p>按一年</p>
                    </div>
                  </div>
                  <div class="menu" ng-click="save_check_price()">
                    <div class="item" ng-repeat="s in eidt_service_time" data-value="{{s.id}}" ng-if="s.time != eidt_product_price.service_time" ng-click="save_check_price(s.id)" >{{s.time}}</div>
                  </div>
                </div>
            </div>
            <div class="field" id="sace_quan_price" style="width:50%">
              <label>全价</label>
              <input name="save_price" id="save_price"  type="text" ng-keyup="save_check_price()" style="margin-left:28px;width:44%;">
            </div>
          </div>

          <div class="inline fluid fields">
            <div class="field" id="save_service_price2" style="width:50%">
              <label>优惠后价格</label>
              <input name="save_service_price" id="save_service_price" type="text" ng-keyup="save_check_price()" value="" style="margin-left:0px;width:44%;">
            </div>
            <div class="field" id="check_month" style="width:50%">
              <label>优惠后延长服务月数(月)</label>
              <input name="save_free_time" id="save_free_time" type="text" ng-keyup="save_check_price()"  value="">
            </div>
          </div>
           <div class="inline fluid fields">
            <div class="field" style="width:50%">
              <label>实际折扣</label>
              <span style="margin-left:16px;" id="save_discount">{{discount | limitTo:4 }} 折</span>
            </div>
          </div>
           <div class="two fields">
            <div class="field">
              <label>备注信息</label>
              <textarea  name="save_note" style="margin-left:60px;" >{{arr_price.note}}</textarea>
            </div>
           
          </div>
           <div class="ui error message"></div>
           
        </form>
  </div>
  <div class="actions" style="margin-top:20px;">
       <div class="center" style="margin-top:-60px;">
        <div class="ui pop_btn_qd positive" >{{'BTN_OK' | translate}}</div>
        <div class="ui pop_btn_qx negative" >{{'BTN_CANCEL' | translate}}</div>
       </div>
    </div>
</div>
        
    
<div class="ui small del modal transition"  id="delete" >
<i class="close icon"></i>
  <div class="header">产品报价删除确认</div>
  <div class="content">
    <p></p>
  </div>
  <div class="actions">
      <div class="center" >
        
        <div class="ui pop_btn_qd positive " ng-click="del_product_price(delete_id)">删除</div>
        <div class="ui pop_btn_qx negative">{{'BTN_CANCEL' | translate}}</div>
      </div>
    </div>
</div>
<!-- 系统信息弹出层 is ending here-->
<div class="ui systemerror modal transition " >
  <div class="header ">系统提示</div>
  <div class="content ">
    <div class="inline fluid fields ">
      <div class="field " style="display: inline-block;width: 5%; " ng-show="productRcode==0 ">
        <i class="thumbs down large icon "></i>
      </div>
       <div class="field " style="display: inline-block;width: 5%; " ng-show="productRcode==1 ">
        <i class="thumbs up large icon "></i>
      </div>
      <div class="field " style="display: inline-block; ">
        <p>{{productMsg}}</p>
      </div>
    </div> 
  </div>
  <div class="actions ">
    <div class="ui positive button " ng-click="XuFeiList()">关闭</div>
  </div>
</div>
<script type="text/javascript">
 $('.ui.selection.dropdown').dropdown();
 $('#frm-add').form({
    on: 'blur',
    inline : true,
    fields: {
      add_name: {
        identifier  : 'add_name',
        rules: [
          {
            type   : 'empty',
            prompt : '请填写报价名称'
          }
        ]
      },
      add_product_name: {
        identifier  : 'add_product_name',
        rules: [
          {
            type   : 'empty',
            prompt : '请填写所属产品'
          }
        ]
      },
      add_service_time: {
        identifier  : 'add_service_time',
        rules: [
          {
            type   : 'empty',
            prompt : '请填写服务期类型'
          }
        ]
      },
      add_price: {
        identifier  : 'add_price',
        rules: [
          {
            type   : 'integer[1..]',
            prompt : '请填写全价'
          }
        ]
      },
      add_service_price: {
        identifier  : 'add_service_price',
        rules: [
          {
            type   : 'integer[1..]',
            prompt : '请填写优惠后价格'
          }
        ]
      },
    }
  });
 $('#frm-save').form({
    on: 'blur',
    inline : true,
    fields: {
      save_name: {
        identifier  : 'save_name',
        rules: [
          {
            type   : 'empty',
            prompt : '请填写报价名称'
          }
        ]
      },
      save_service_time: {
        identifier  : 'save_service_time',
        rules: [
          {
            type   : 'empty',
            prompt : '请填写服务期类型'
          }
        ]
      },
      save_price: {
        identifier  : 'save_price',
        rules: [
          {
            type   : 'integer[1..]',
            prompt : '请填写全价'
          }
        ]
      },
      
    }
  });
</script>